package com.wenhui.schoolyardinfo.login.presenter.base;

import java.lang.ref.WeakReference;

/**
 * author    : Urasaki
 * e-mail    : 1164688204@qq.com
 * date      : 2019/7/9 17:14
 * introduce :
 */

public abstract class BasePresenter<T> {

    protected WeakReference<T> modelView;

    public void attachView(T view) {
        this.modelView = new WeakReference<T>(view);
    }

    public void dettachView() {
        this.modelView.clear();
    }

    protected T getView() {
        return modelView.get();
    }
}
